package elements.messages_TAB;


import com.robotium.solo.Solo;

import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import utils.Util;
import utils.MyException.NotFoundException;

public class MessageTAB_Page {
	private Solo solo;

	public MessageTAB_Page(Solo solo) {
		this.solo=solo;
	}
//	com.mainbo.homeschool:id/to_noti_comment
//	com.mainbo.homeschool:id/to_noti_sys
	private LinearLayout comments,systemMessages;
//	com.mainbo.homeschool:id/content
	private TextView applyForJoinClass;
//	com.mainbo.homeschool:id/refuse_view
//	com.mainbo.homeschool:id/agree_view
	private Button refuse_view,agree_view;
	
	
	public LinearLayout getComments() throws NotFoundException {//评论
		comments=(LinearLayout) Util.myGetView(solo, "to_noti_comment");
		return comments;
	}
	public void clickOn_comments() throws NotFoundException{
		solo.clickOnView(getComments());
	}
	
	
	public LinearLayout getSystemMessages() throws NotFoundException{//系统消息
		systemMessages=(LinearLayout) Util.myGetView(solo, "to_noti_sys");
		return systemMessages;
	}
	public void clickOn_SystemMessages() throws NotFoundException{
		solo.clickOnView(getSystemMessages());
	}
	
	
	public TextView getApplyForJoinClass() throws NotFoundException{//申请加班文本内容,最多等待30s
		applyForJoinClass=(TextView) Util.myGetView(solo, "content",30000);
		return applyForJoinClass;
	}
	
	
	public Button getRefuse_view() throws NotFoundException{//拒绝加班按钮
		refuse_view=(Button) Util.myGetView(solo, "refuse_view");
		return refuse_view;
	}
	public void clickOn_Refuse_view() throws NotFoundException{
		solo.clickOnView(getRefuse_view());
	}
	
	
	public Button getAgree_view() throws NotFoundException{//同意加班按钮
		agree_view=(Button) Util.myGetView(solo, "agree_view");
		return agree_view;
	}
	public void clickOn_Agree_view() throws NotFoundException{
		solo.clickOnView(getAgree_view());
	}
	//点击消息TAB
	public void clickOn_MessageTAB(){
		solo.clickOnText("^消息$");
	}
}
